import App from "./App";

// #ifndef VUE3
import Vue from "vue";
import "./uni.promisify.adaptor";
Vue.config.productionTip = false;
App.mpType = "app";
const app = new Vue({
	...App,
});
app.$mount();
// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";
export function createApp() {
	const app = createSSRApp(App);
	return {
		app,
	};
}
// #endif

/**
 * 导航栏的总高度
 */
Vue.prototype.$navigationHeight = uni.getSystemInfoSync()["statusBarHeight"] + 45;

/**
 * 导航栏
 */
import navigationBar from "@/components/navigationBar/navigationBar.vue";
Vue.component("navigationBar", navigationBar);
/**
 * 空数据
 */
import uEmpty from "@/components/emptyData/emptyData.vue";
Vue.component("uEmpty", uEmpty);

/**
 * 图片的路径
 */
import config from "@/utils/config.js";
Vue.prototype.imageURL = config.imageURL;
Vue.prototype.getImageURL = function (url) {
	return Vue.prototype.imageURL + url;
};
/**
 * js方法
 */
import filter from "@/utils/filters.js";
Vue.prototype.$filters = filter;
/**
 * 吐司
 */
import st from "@/utils/showtoast.js";
Vue.prototype.$st = st;
/**
 * 存储的信息
 */
import stoarge from "@/utils/stoarge.js";
Vue.prototype.$stoarge = stoarge;

/**
 * 点击事件 参数带 handle 回调方法的
 */
Vue.prototype.$handle = function (item) {
	return item.handle(item);
};

/**
 * <view class="wrap-test">
			<block v-for="(item, index) in banner" :key="index">
				<image class="img" lazy-load :src="item" @error="$set(banner, index, $defaultIcon)" />
			</block>
		</view>
 */
Vue.prototype.$defaultIcon = "/static/common/noData.png";
